#include <stdio.h>
#include <unistd.h>

int g_val = 100;

int main()
{
    pid_t pid = fork();
    if(pid < 0)
    {
        perror("fork");
        return 0;
    }
    else if(pid == 0)
    {
        //child
        printf("i am child, g_val:%d,&g_val:%p\n",g_val,&g_val);
    }
    else 
    {
        //father
        
        printf("i am father, g_val:%d,&g_val:%p\n",g_val,&g_val);
    }
    return 0;
}
